<?php if(!defined('HDPHP_PATH'))exit;C('SHOW_NOTICE',FALSE);?>
<!DOCTYPE html>
<html>

	<head>
		<meta charset="utf-8">
		<title>内容页</title>
		<link rel="stylesheet" type="text/css" href="http://127.0.0.1/mogujie/Static/Home/css/content.css" />
		<link rel="stylesheet" type="text/css" href="http://127.0.0.1/mogujie/Static/Home/css/base.css" />
		
		<?php if(!defined('HDPHP_PATH'))exit;C('SHOW_NOTICE',FALSE);?>
<link rel="stylesheet" href="http://127.0.0.1/mogujie/Static/Home/css/index.css" />
<link rel="stylesheet" type="text/css" href="http://127.0.0.1/mogujie/Static/Home/css/animate.css"/>
<script type="text/javascript" src="http://127.0.0.1/mogujie/Static/js/jquery-1.8.2.min.js"></script>
<script type="text/javascript" src="http://127.0.0.1/mogujie/Static/mgjs/index.js"></script>
</head>

<body>
<!-- 首页首屏开始**************************** -->


<!-- 顶部红色区域 -->
<div id="top">
	<!-- 顶级 -->
	<div id="pic">
	<!-- 右侧 -->
		<ul>
			    <?php if($hd['session']['username'] && $hd['session']['uid']){ ?>
				<li class='userinfo'>
					欢迎回来<a href="<?php echo U('Search/index');?>" class='uname' style="margin-right:10px ;"><?php echo $hd['session']['username'];?></a>
				</li>
				<li class="sp">|</li>
				<li><a href="<?php echo U('Login/out');?>">退出</a></li>  
			<?php }else{ ?>
				<li><a href="<?php echo U('Register/index');?>">注册</a></li>
				<li><a href="<?php echo U('Login/index');?>">登陆</a></li>
			<?php } ?>
			<li><span>|</span><a href="">QQ登陆</a></li>
			<li><a href="">微信登陆</a></li>
			<li><a href="">微博登陆</a></li>
			<li><span>|</span><a href="">手机蘑菇街</a></li>
			<li><span>|</span><a href="">帮助中心</a></li>
			
		</ul>
		<!-- 中部 -->
		<div class="logo">
			<div class="logo-left">
				<a href="<?php echo U('Index/index');?>"><img src="http://127.0.0.1/mogujie/Static/Home/images/wjmsj.png" alt="" /></a>
			</div>
			<!-- 搜索区域 -->
			<div class="logo-middle">
				<form action="">
					<input type="text" class="l" value=" 清爽秋季，运动起来" />
					<input type="submit" class="y" value="" />
				</form>
				<!-- 购物车 -->
				<div class="car">
					<div class="xia-1">
						<a href="<?php echo U('Cart/index');?>">购物车
							<span>
								    <?php if($_SESSION['cart']){ ?>
								<?php echo $hd['session']['cart']['total_rows'];?>
								<?php }else{ ?>0<?php } ?>
							</span>件
						</a>
					</div>
					<div class="xia-2">
						    <?php if($_SESSION['cart']){ ?>
						<div>购物车中有<span style="color: #FF339B;">&nbsp;<?php echo $hd['session']['cart']['total_rows'];?>&nbsp;</span>件商品！
							<br />
							总价:￥<?php echo $hd['session']['cart']['total'];?>
						</div>
						<?php }else{ ?><div>购物车中还没有商品！</div><?php } ?>
					</div>	
				</div>
				<!-- 我的订单 -->
				<div class="count"><a href="<?php echo U('Order/index');?>">我的订单</a></div>
			</div>
		</div>
	</div>
</div>
<!-- 顶部红色区域结束 -->

<!-- 导航条开始 -->
<div id="nav">
	
	<ul>
		
		<li><a href="<?php echo U('Index/index');?>" class="a">首页</a></li>
		<?php foreach ($cateData as $k=>$v){?>
			<li><a href="<?php echo U('List/index',array('cid'=>$v['cid']));?>"><?php echo $v['cname'];?></a></li>
		<?php }?>
	</ul>
	<a href=""></a><img src="http://127.0.0.1/mogujie/Static/Home/images/ds3.jpg" alt="" />
</div>
<!-- 导航条结束 -->
<div id="red"></div>
		<script src="http://127.0.0.1/mogujie/Static/Home/js/base.js"></script>
		<script src="http://127.0.0.1/mogujie/Static/Home/js/jquery.jqzoom.js"></script>
		<script type="text/javascript">
			$(function(){
				$('.dl_5 a').click(function(){
//					alert(1);
					$(this).addClass('redss').siblings().removeClass('redss');
					//选择的长度
					var len = $('.redss').length;
					//li 的长度，就是有几种规格
					var liLen = $('.dl_5').length;
					//选中2个以上才发送异步
					if(len>=liLen){
						var id = '';
						$.each($('.redss'),function(){
							id += $(this).attr('specId') + ',';
							$('input[name=price]').val(id);
						})
//						alert(id);
						var gid = <?php echo $shopData['gid'];?>;
//						alert(gid);
//						//下面发异步，查询数据库
						$.ajax({
							type:"post",
							url:"<?php echo U('Content/getAdd');?>",
							data:{id:id,gid:gid},
							dataType:'json',
							success:function(phpData){
								if(phpData['inventory']){
									$('.p_2').html(phpData['specArr']);
									$('.dl_6 .dd').html('库存：'+phpData['inventory']+'件');
									$('input[name=specid]').val(phpData['specArr']);
								}else{
									$('.dl_6 .dd').html('库存：暂无库存');
								}
							}
						});
						
						
						
						
					}
						
			
				})
				//点击+-购买商品
				var num = 1;
				//商品数量
				$('.add').click(function(){
//					alert(1);
					num=num+1;
					$('#num').val(num);
				})
				$('.del').click(function(){
					if(num==1){
						return false;
					}
					num=num-1;
					$('#num').val(num);
				})

					//如果暂无库存，则不能提交
				$('form').submit(function(){
					//如果没有库存则不能提交
					if($('.kucun').html()=='库存：暂无库存'){
						return false;
					}
					//如果没有选择规格则不能提交
					var len = $('.redss').length;
					//li 的长度，就是有几种规格
					var liLen = $('.dl_5').length;
					//选中2个以上才能提交
					if(len<liLen){
						$('.messeg').html('请选择规格！');
						return false;
					}
					/*if(session["uid"]==null){
						hd_modal_test();
						return false;
					}*/
				})
				
			})
		</script>
		<!--内容开始-->
		<div id="content">
			<div class="content_left" >
				<center>
					        <?php
        //初始化
        $hd['list']['v'] = array(
            'first' => false,
            'last'  => false,
            'total' => 0,
            'index' => 0
        );
        if (empty($detail['shop_pic'])) {
            echo '';
        } else {
            $listId = 0;
            $listShowNum=0;
            $listNextId=0;
            foreach ($detail['shop_pic'] as $v) {
                //开始值
                if ($listId<0) {
                    $listId++;
                    continue;
                }
                //步长
                if($listId!=$listNextId){$listId++;continue;}
                //显示条数
                if($listShowNum>=1)break;
                //第几个值
                $hd['list'][v]['index']++;
                //第1个值
                $hd['list'][v]['first']=($listId == 0);
                //最后一个值
                $hd['list'][v]['last']= (count($detail['shop_pic'])-1 <= $listId);
                //总数
                $hd['list'][v]['total']++;
                //增加数
                $listId++;
                $listShowNum++;
                $listNextId+=1
                ?>
						<div id="preview" class="spec-preview "> <span class="jqzoom" ><img jqimg="http://127.0.0.1/mogujie/<?php echo $v['big'];?>" src="http://127.0.0.1/mogujie/<?php echo $v['mid'];?>" /></span> </div>
					<?php }}?>
					<!--缩图开始-->
					<div class="spec-scroll"> <a class="prev">&lt;</a> <a class="next">&gt;</a>
						<div class="items">
							<ul>
								<?php foreach ($detail['shop_pic'] as $k=>$v){?>
									<li><img alt="" bimg="http://127.0.0.1/mogujie/<?php echo $v['big'];?>" src="http://127.0.0.1/mogujie/<?php echo $v['mid'];?>" onmousemove="preview(this);"></li>
								<?php }?>
							</ul>
						</div>
					</div>
					<!--缩图结束-->
				</center>

			</div>
			<div class="content_middle">

				<p><?php echo $shopData['gname'];?></p>
				
				<div class="d_1">原价：<span><?php echo $shopData['marketprice'];?>元</span></div>
				<div class="d_2">
					<span class="sp_1">现价：</span><span class="sp_2 p_2" style="font-family: '微软雅黑';">¥ <?php echo $shopData['shopprice'];?></span> <span class="sp_3">7折</span>
				</div>
				<div class="d_3">
					<ul>
						<li class="li_1">
							<p class="xinxin">5分</p>
							<p>评价</p>
						</li>
						<li class="li_2">
							<p>758</p>
							<p>销量</p>
						</li>
						<li class="li_3">
							<p>92</p>
							<p>累计评价</p>
						</li>
					</ul>
				</div>
				<div class="d_4">
					<!--<dl class="dl_1">
				<dt>优惠：</dt>
				<dd class="bg">满件立减</dd>
				<dd>全店满2件减3元</dd>
			</dl>
			<br /><br />
			<dl class="dl_2">
				<dt>配送：</dt>
				<dd>广东省广州市发出</dd>
				<dd>全国包邮</dd>
			</dl>
			<br /><br />
			<dl class="dl_3">
				<dt>客服：</dt>
				<dd></dd>
			</dl>-->
					<!--<br /><br /><br />-->
					<?php foreach ($tempSpec as $k=>$v){?>
						<dl class="dl_5">
							<dt><?php echo $v['name'];?>：</dt>
							<dd>
								<?php foreach ($v['value'] as $kk=>$vv){?>
									<a href="javascript:;" specId="<?php echo $vv['gtid'];?>"><?php echo $vv['gtvalue'];?></a>
								<?php }?>
								<!--<a href="javascript:;" specId="111">紫色</a>-->
							</dd>
						</dl>
						<br />
						<br />
						<br />
				<?php }?>
				<!--***************-->
				<!--提交购物车需要的4种数据，用隐藏域传过去-->
				<form id="form" action="<?php echo U('Cart/index');?>" method="post">
					<dl class="dl_6">
						<dt>数量：</dt>
						<dd><a href="javascript:;"><span class="sp_1 del"></a></span><input type="" name="num" id="num" value="1" style="border: 1px solid #DDDDDD;float: left;width: 50px;height: 25px;text-align: center;"/><a href="javascript:;"><span class="sp_2 add"></span></a></dd>
						<dd class="dd kucun">库存：10000件</dd>
					</dl>
				</div>
				<span class="messeg" style="margin-left: 170px;font-size: 15px;"></span>
				<div class="d_5">
					<a href="<?php echo U('Order/index');?>" class="a_left"></a>
						
						<input type="hidden" name="gid" value="<?php echo $shopData['gid'];?>"/>
						<input type="hidden" name="gname" value="<?php echo $shopData['gname'];?>"/>
						<input type="hidden" name="specid" value=""/>
						<input type="hidden" name="price" value=""/>
						<input type="submit" name="" id="" value="加入购物车" class="a_right"/>
						
					</form>
					
					<!--给购物车加一个点击事件，判断用户是否登陆-->
					<script type="text/javascript">
						$(function(){
							$('#form').submit(function(){
								var x=<?php if(isset($_SESSION['uid'])){echo "1";}else{echo 0;} ?>;
								if(!x){
									window.location.href="<?php echo U('Login/index');?>"
									return false;
								}
							})
						})
					</script>
					<!--*******************-->
					<a href="" ></a>
				</div>
				<div class="d_6">
					<div class="div_1"><b></b><a href="">1286</a></div>
					<div class="div_2"><b></b><a href="">分享</a></div>
					<div class="div_3"><a href="">举报</a></div>
				</div>
				<div class="d_7"></div>
				<div class="d_8">

				</div>
			</div>
			<div class="content_right">
				<p><span>正在热卖</span></p>
				<div>
					<ul>
						<li>
							<a href=""><img src="http://127.0.0.1/mogujie/Static/Home/images/contright_1.jpg" alt="" /></a>
						</li>
						<li>
							<a href=""><img src="http://127.0.0.1/mogujie/Static/Home/images/contright_2.jpg" alt="" /></a>
						</li>
						<li>
							<a href=""><img src="http://127.0.0.1/mogujie/Static/Home/images/contright_3.jpg" alt="" /></a>
						</li>
						<!--<li><a href=""><img src="http://127.0.0.1/mogujie/Static/Home/images/contright_4.jpg" alt="" /></a></li>-->
					</ul>
				</div>
			</div>
		</div>

		<!--内容结束-->
		<!--商品详情开始-->
		<div id="for_det">
			<ul>
				<li><a href="" class="la_first">商品详情</a></li>
				<li><a href="">买家评价(5457)</a></li>
				<li><a href="">90天销量(32537)</a></li>
			</ul>
		</div>

		<!--店主推荐-->
		<div id="boss">
			<div class="b_top">店主推荐 ARRIVALS</div>
			<div class="b_bottom">
				<ul>
					<li>
						<a href=""><img src="http://127.0.0.1/mogujie/Static/Home/images/mei0.jpg" alt="" /></a>
						<p><a href="">欧美时尚显瘦针织背心裙</a></p>
						<p>
							<span class="rmb"><u></u>36.40</span>
							<span class="like">1688</span>
						</p>
					</li>
					<li>
						<a href=""><img src="http://127.0.0.1/mogujie/Static/Home/images/mei0.jpg" alt="" /></a>
						<p><a href="">欧美时尚显瘦针织背心裙</a></p>
						<p>
							<span class="rmb"><u></u>36.40</span>
							<span class="like">1688</span>
						</p>
					</li>
					<li>
						<a href=""><img src="http://127.0.0.1/mogujie/Static/Home/images/mei0.jpg" alt="" /></a>
						<p><a href="">欧美时尚显瘦针织背心裙</a></p>
						<p>
							<span class="rmb"><u></u>59.00</span>
							<span class="like">1688</span>
						</p>
					</li>
					<li>
						<a href=""><img src="http://127.0.0.1/mogujie/Static/Home/images/mei0.jpg" alt="" /></a>
						<p><a href="">欧美时尚显瘦针织背心裙</a></p>
						<p>
							<span class="rmb"><u></u>36.40</span>
							<span class="like">1688</span>
						</p>
					</li>
					<li>
						<a href=""><img src="http://127.0.0.1/mogujie/Static/Home/images/mei0.jpg" alt="" /></a>
						<p><a href="">欧美时尚显瘦针织背心裙</a></p>
						<p>
							<span class="rmb"><u></u>36.40</span>
							<span class="like">1688</span>
						</p>
					</li>
				</ul>
			</div>
		</div>

		<!--店主推荐结束-->

		<!--图片-->
		<div id="tu">
			<a href=""><img src="http://127.0.0.1/mogujie/Static/Home/images/tu9.jpg" alt="" /></a>
		</div>

		<?php if(!defined('HDPHP_PATH'))exit;C('SHOW_NOTICE',FALSE);?>
<!-- 底部图片 -->
<div id="bottom">
	<div class="bfb ">
		<a href=""><img src="http://127.0.0.1/mogujie/Static/Home/images/bottom-1.png" alt="" /></a>
		<a href=""><img src="http://127.0.0.1/mogujie/Static/Home/images/bottom-2.png" alt="" /></a>
		<a href=""><img src="http://127.0.0.1/mogujie/Static/Home/images/bottom-3.png" alt="" class="bfb-last" /></a>
	</div>
</div>
<!-- 底部文字 -->
<div id="b_font">
	<div class="bb_font">
		<div class="b_font_l">
			<a href="" class="bone"></a>
			<p>营业执照注册号：<a href="">330106000129004</a></p>
			<p>增值电信业务经营许可证：<a href="">浙B2-20110349</a></p>
			<p>ICP备案号：浙ICP备10044327号-3</p>
			<p>©2015 Mogujie.com 杭州卷瓜网络有限公司</p>		
		</div>
		<div class="b_font_r">
			<dl>
				<dt>公司</dt>
				<dd><a href="">关于我们</a></dd>
				<dd><a href="">招聘信息</a></dd>
				<dd><a href="">联系我们</a></dd>
			</dl>  

			<dl>
				<dt>消费者</dt>
				<dd><a href="">帮助中心</a></dd>
				<dd><a href="">意见反馈</a></dd>
				<dd><a href="">手机版下载</a></dd>
			</dl>
			<dl>
				<dt>商家</dt>
				<dd><a href="">免费开店</a></dd>
				<dd><a href="">商家入驻</a></dd>
				<dd><a href="">管理后台</a></dd>
			</dl>
			<dl class="llast">
				<dt>权威认证</dt>
				<dd>
					<a href="" class="llast-1"></a>
					<a href="" class="llast-2"></a>
					<a href="" class="llast-3"></a>
				</dd>
			</dl>
		</div>
	</div>
</div>




<!-- 底部文字结束 -->
</body>
</html>
